﻿#pragma once

#include <glm/glm.hpp>

#include "SourceCode/Renderer/VertexArray.h"

namespace Hazal
{
	class CRendererAPI
	{
	public:
		enum class API
		{
			None = 0,
			OpenGL = 1,
			Direct3D = 2,	/// TODO
		};

	public:
		/// <summary>
		/// 初始化
		/// </summary>
		virtual void Init() = 0;

		/// <summary>
		/// 设置视口大小
		/// </summary>
		/// <param name="unWidth">Width</param>
		/// <param name="unHeight">Height</param>
		virtual void SetViewport(uint32_t unWidth, uint32_t unHeight) = 0;

		/// <summary>
		/// 设置屏幕的清除颜色
		/// </summary>
		/// <param name="vecColor"></param>
		virtual void SetClearColor(const glm::vec4& vecColor) = 0;

		/// <summary>
		/// 清除屏幕
		/// </summary>
		virtual void Clear() = 0;

		/// <summary>
		/// 基于顶点索引绘图
		/// </summary>
		/// <param name="pVertexArray"></param>
		virtual void DrawIndexed(Ref<CVertexArray>& pVertexArray, uint32_t unCount = 0) = 0;

	public:
		inline static API GetAPI()
		{
			return s_API;
		}

	private:
		static API s_API;
	};
}
